<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    let p1 = new Promise((resolve, reject) => {
      resolve('fulfilled')
    }).then(
      value => {
        console.log(value)
        // return new Promise((resolve, reject) => {
        //   resolve('成功')
        // })

        // return {
        //   then(resolve, reject) {
        //     // resolve('这是对象')
        //     setTimeout(() => {
        //       resolve('这是对象')
        //     }, 2000)
        //   }
        // }

        // class P {
        //   then(resolve, reject) {
        //     // resolve('这是对象')
        //     setTimeout(() => {
        //       resolve('这是对象')
        //     }, 2000)
        //   }
        // }
        // return new P()

        return class {
          static then(resolve, reject) {
            resolve('这是一个静态方法')
          }
        }
      },
      reason => {}
    ).then(
      value => {
        console.log(value)
      },
      reason => {}
    )
  </script>
</body>
</html>